#include <iostream>
using namespace std;

#include "Tabparser.h"
#include "MyStruct.h"

/*TObject * customFunction(string str)
{
    return NULL;
}
*/
class B
{
    public:
        ~B()
        {
            cout<<"BBBBBBBB"<<endl;
        }
};
class A
{
    public:
        A()
        {
            b = (void *) new B();
        }
        ~A()
        {
            cout<<"ccccccccccc"<<endl;
            delete reinterpret_cast<B *>(b);
        }
    void * b;
};
int main()
{
/*    {
        void * p = (void * ) new A();
        delete reinterpret_cast<A *>(p);
    }*/
    /*Tabparser parser;
    TObjectList * table = parser.check("schema.txt", "str.txt", customFunction);
    cout<<table->getObjectList(0)->getObject(0)->getInt()<<endl;
    cout<<table->getObjectList(2)->getObject(1)->getString()<<endl;
    cout<<table->getObjectList(1)->getObjectList(5)->getObject(1)->getInt()<<endl;
    */
    //cout<<typeid(int)<<endl;
    for(int i = 1; i < 2; i++)
    {
        TObjectList * table = new TObjectList();
        MyStruct * st = new MyStruct();
        st->c = "dsdsd";
        table->push_back(st);
        //delete table;
        TObjectList * table1 = new TObjectList();
        table1->push_back(table);
        //cout<<(dynamic_cast<MyStruct*>(table1->getObjectList(0)->getObject(0)))->c<<endl;
        delete table1;
    }
    system("pause"); 
    return 0;
}
